home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 774 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.9 KB

  1. Path: solon.com!not-for-mail
  2. From: seebs@solon.com (Peter Seebach)
  3. Newsgroups: comp.std.c,comp.lang.c.moderated
  4. Subject: Re: printf() format extensions - looking for beta testers...
  5. Date: 21 Apr 1996 12:40:05 -0500
  6. Organization: Usenet Fact Police (Undercover)
  7. Sender: clc@solutions.solon.com
  8. Approved: clc@solutions.solon.com
  9. Message-ID: <4ldrtl$5tq@solutions.solon.com>
  10. References: <4ksk72$rm6@solutions.solon.com> <4l33qn$7rv@solutions.solon.com> <4l3kg4$avi@solutions.solon.com> <4lbd8k$m2t@solutions.solon.com>
  11. Reply-To: seebs@solon.com
  12. NNTP-Posting-Host: solutions.solon.com
  13.  
  14. In article <4lbd8k$m2t@solutions.solon.com>,
  15. Sean 'Captain Napalm' Conner <spc@gate.net> wrote:
  16. >  And one I'm wary of.  Again, if I use pre-written code that uses a character
  17. >for a new format that my code wants to use, something isn't going to work
  18. >properly (<sarcasm> and given how well Unix code is well documented
  19. ></sarcasm>).
  20.  
  21. This is a definite potential nuisance, yes.  But it's a "feature" - you
  22. could, for instance, magically cause scanf and printf to start working
  23. with numbers with ,'s or .'s every N digits.
  24.  
  25. >  As a defence, at least have a compile time option (or run time option) to
  26. >flag options that are redefined, to at least warn the programmer "Thar be
  27. >possible bugs ahead, Arrrrrrrrg!  You have been warned, me mateys!"
  28.  
  29. Heh.  Not a hopeless idea.
  30.  
  31. >  And I'm afraid that it'll make my life a living hell (sorry, but I have
  32. >enough problems working with existing poorly written C code (that I have to
  33. >use or get to work) to fully endorse such a construct.    Nothing personal).
  34.  
  35. This is something I'm wary of too.  But honestly, so much code would me
  36. so much easier to write expressively, that I really want the ability
  37. to do this.
  38.  
  39. >  Does it HAVE to be printf()?    Can't you create formatp() and use that?  Or
  40. >are you wanting to change some of the default behaviors of printf() so you (or
  41. >someone else) don't(doesn't) have to change much code?
  42.  
  43. I want to do printf because I disapprove of redundancies; since printf does
  44. what I want to use as a basis, I'd rather extend printf than write another
  45. function which is nearly identical; printf() couldn't be implemented in
  46. terms of a user-definable formatp(), without huge nuisance issues, so it'd
  47. be basically impossible to do "right" without duplicating the majority
  48. of the printf formatting code - which is already sorta big.
  49.  
  50. I have tons of code I'd eventually rewrite with this, and I may start using
  51. my printf-based implementation even sooner, but no, there's not a huge body
  52. of existing code I care about; this is one of the reasons it's important to
  53. me that existing code survive any changes without effects on its behavior.
  54.  
  55. -s
  56. -- 
  57. Peter Seebach - seebs@solon.com - Copyright 1996 Peter Seebach.
  58. C/Unix wizard -- C/Unix questions? Send mail for help.  No, really!
  59. Unsolicited email is not welcome, and will be billed for at consulting rates.
  60. The *other* C FAQ - http://www.solon.com/~seebs/c/c-iaq.html
  61.